package com.wnhz.work.yz.adapter;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.TextView;

import com.wnhz.work.yz.R;

/**
 * Created by admin on 2016/12/19.
 */
public class PassOthersAdapter extends BaseAdapter {
    private Context context;
    private View.OnClickListener listener;

    public PassOthersAdapter(Context context, View.OnClickListener listener) {
        this.context = context;
        this.listener = listener;
    }

    @Override
    public int getCount() {
        return 3;
    }

    @Override
    public Object getItem(int position) {
        return null;
    }

    @Override
    public long getItemId(int position) {
        return 0;
    }

    @Override
    public View getView(int position, View convertView, ViewGroup parent) {
        PassOthersViewHolder viewHolder = new PassOthersViewHolder();
        if (convertView == null) {
            convertView = LayoutInflater.from(context).inflate(R.layout.passothers_item, null);
            viewHolder.iv_head = (ImageView) convertView.findViewById(R.id.iv_head);
            viewHolder.tv_name = (TextView) convertView.findViewById(R.id.tv_name);
            viewHolder.tv_submit = (TextView) convertView.findViewById(R.id.tv_submit);

            convertView.setTag(viewHolder);
        } else {
            viewHolder = (PassOthersViewHolder) convertView.getTag();
        }


        viewHolder.tv_submit.setOnClickListener(listener);
        viewHolder.tv_submit.setTag(position);

        return convertView;
    }

    class PassOthersViewHolder {
        ImageView iv_head;
        TextView tv_name;
        TextView tv_submit;
    }
}
